const {
    dialog
} = require('electron')

const handleShowOpenDialog = (mainWindow) => {
    // 打开对话框不能同时是文件选择器和目录选择器, 则将显示为目录选择器
    return dialog.showOpenDialog(mainWindow, {
        // 对话框的默认展示路径
        defaultPath: '',
        // 对话框相关属性
        properties: ['openFile', 'showHiddenFiles', 'multiSelections']
    })
}

const handleShowSaveDialog = (mainWindow) => {
    return dialog.showSaveDialog(mainWindow)
}

module.exports = {
    handleShowOpenDialog,
    handleShowSaveDialog
}